import request from '@/utils/request'

// 创建证书配置
export function createCertificate(data) {
  return request({
    url: '/exam/certificate/create',
    method: 'post',
    data: data
  })
}

// 更新证书配置
export function updateCertificate(data) {
  return request({
    url: '/exam/certificate/update',
    method: 'put',
    data: data
  })
}

// 删除证书配置
export function deleteCertificate(id) {
  return request({
    url: '/exam/certificate/delete?id=' + id,
    method: 'delete'
  })
}

// 获得证书配置
export function getCertificate(id) {
  return request({
    url: '/exam/certificate/get?id=' + id,
    method: 'get'
  })
}

// 获得证书配置分页
export function getCertificatePage(query) {
  return request({
    url: '/exam/certificate/page',
    method: 'get',
    params: query
  })
}

// 导出证书配置 Excel
export function exportCertificateExcel(query) {
  return request({
    url: '/exam/certificate/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
